package tripleo.histore;

import java.io.InputStream;
import java.io.OutputStream;

/**
 * Date: Feb 8, 2005
 * Time: 11:04:27 PM
 * <p/>
 * $Id: HiStore.java,v 1.3 2005/10/11 19:22:08 olu Exp $
 */
public interface HiStore {
	InputStream readStreamFor(long identifier, char aFor) throws ConsistencyFailure;

	OutputStream writeStreamFor(long identifier, char aFor) throws ConsistencyFailure;

	String mangle_name(long identifier, char aFor);

	HiStoreEntry alloc(String aKey) throws AllocationFailure, ConsistencyFailure;

	HiStoreEntry insert(String aKey) throws AllocationFailure, ConsistencyFailure;

//	HiStoreEntry first(); // TODO not a dirsvr!!

	void removeEntryForKey(long identifier) throws ConsistencyFailure;
}

enum AllocFor { FOR_CONTENT('C'), FOR_METADATA('M');
	final private char value;
	AllocFor(char c) {value=c;}
}
